﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class TinTuc : System.Web.UI.Page
{
    private DataSet objDataSet;
    protected void Page_Load(object sender, EventArgs e)
    {
        // Load the grid only the first time the page is loaded
        if (!Page.IsPostBack)
        {
            // Load the categories grid
            BindGrid();
        }
    }

    // Populate the GridView with data
    private void BindGrid()
    {
        TinTucBUS objTT = new TinTucBUS(TGDDConfiguration.DbConnectionString);
        try
        {
            objDataSet = objTT.SelectTinTucAll_Summary(TGDDConfiguration.NoiDungTinTucLength);
            repTinTuc.DataSource = objDataSet.Tables[0];
            repTinTuc.DataBind();
        }
        catch (System.Exception e)
        {
            throw new Exception(e.Message, e.InnerException);
        }
    }
}
